package com.kabigon.tiny.controller;

import com.alibaba.excel.EasyExcel;
import com.kabigon.tiny.excel.NoModelDataListener;
import lombok.SneakyThrows;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * @author xu.biao
 * @version v1.0
 * @Package com.kabigon.tiny.controller
 * @data 2022/8/10 1:33
 */
@RestController

public class WebTest {

    @SneakyThrows
    @PostMapping("upload")
    public String upload(MultipartFile file) throws IOException {
        EasyExcel.read(file.getInputStream(), new NoModelDataListener()).sheet().headRowNumber(0).doRead();
        return "success";
    }

}
